<template> 
   <div id="">
        <h1>{{msg}}</h1>
        <School :getSchoolName="getSchoolName"/>           
        <!--<Student ref="title"/> -->
        <Student @weiwei="getStudentName" @demo="m1"/>
    </div>
</template>

<script>
import School from '../components/School.vue'
import Student from '../components/Student.vue'
export default {
  name:'App',
  data() {
    return {
      msg:'你好啊玮玮'
    }
  },
  components:{
    School,Student
  },
  methods: {
    getSchoolName(e){

      alert('APP已收到School！'+e)
    },
    getStudentName(name,...params){
      // alert('111') 
      alert('APP已收到Student！'+name+params)
    },
    m1(){
      console.log("demo!!!! m1~~~~~~");
    }
  },
  mounted() {
      // this.$refs.title.$on('weiwei',this.getStudentName)
      //this.$refs.title.$once('weiwei',this.getStudentName)
  },
}
</script>

<style>

</style>